package com.mentalsurvey.service.impl;

import com.mentalsurvey.mapper.PaperMapper;
import com.mentalsurvey.service.PaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class PaperServiceImpl implements PaperService {

    @Autowired
    private PaperMapper paperMapper;

    @Override
    public Map<String, Object> getPaperDetails(Integer paperId, String paperCode) {
        Map<String, Object> map = new HashMap<>();
        map.put("questions", paperMapper.selectQuestionsByPaperId(paperId));
        map.put("options", paperMapper.selectOptionsByPaperCode(paperCode));
        return map;
    }
}